package nr.co.mhgames.polyanim.interpolation;

/**
 * The simplest interpolator available: performs the normal linear
 * interpolation.
 * <p>
 * When B is some value, and A a value between [0, B]: <b>Result = A / B</b>
 * 
 * @author Mika Halttunen
 */
public final class LinearInterpolator implements Interpolator {
	/**
	 * Static instance, use this to avoid allocating new instances. Provided for
	 * convenience.
	 */
	public static final LinearInterpolator instance = new LinearInterpolator();


	/**
	 * Interpolates linearly between the provided values:
	 * <code>result = pos / maxPos</code>.
	 * 
	 * @see {@link Interpolator#interpolate(float, float)}
	 */
	public final float interpolate(float pos, float maxPos) {
		return pos / maxPos;
	}


	public final void parseFrom(String params) {
	}
}
